package com.insist.dao;

import com.insist.entity.RewardInfo;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by Administrator on 2016/7/5.
 */
public interface RewardInfoDao extends JpaRepository<RewardInfo,Long> {
    @Query("select u from RewardInfo u order by id desc")
    List<RewardInfo> findRewardListLimit(Pageable page);

    List<RewardInfo> findByProductId(Long productId);

    List<RewardInfo> findByUserId(Long loginUserId);
}
